$OpenBSD: patch-gcc_config_alpha_alpha_c,v 1.4 2013/06/07 07:54:23 pascal Exp $
--- gcc/config/alpha/alpha.c.orig	Thu Aug  9 23:49:40 2012
+++ gcc/config/alpha/alpha.c	Sat Apr 13 16:20:31 2013
@@ -227,6 +227,10 @@ alpha_handle_option (size_t code, const char *arg, int
       target_flags |= MASK_IEEE_CONFORMANT;
       break;
 
+    case OPT_mno_ieee:
+      target_flags &= ~(MASK_IEEE_WITH_INEXACT|MASK_IEEE_CONFORMANT);
+      break;
+
     case OPT_mtls_size_:
       if (value != 16 && value != 32 && value != 64)
 	error ("bad value %qs for -mtls-size switch", arg);
@@ -487,11 +491,17 @@ alpha_option_override (void)
   if (!global_options_set.x_g_switch_value)
     g_switch_value = 8;
 
+#ifdef OPENBSD_NATIVE
+  /* Make -fpic behave as -fPIC unless -msmall-data is specified. */
+  if (flag_pic == 2 && TARGET_SMALL_DATA)
+    warning (0, "-fPIC used with -msmall-data");
+#else
   /* Infer TARGET_SMALL_DATA from -fpic/-fPIC.  */
   if (flag_pic == 1)
     target_flags |= MASK_SMALL_DATA;
   else if (flag_pic == 2)
     target_flags &= ~MASK_SMALL_DATA;
+#endif
 
   /* Align labels and loops for optimal branching.  */
   /* ??? Kludge these by not doing anything if we don't optimize and also if
@@ -7823,6 +7833,9 @@ alpha_expand_prologue (void)
   sa_size = alpha_sa_size ();
   frame_size = compute_frame_size (get_frame_size (), sa_size);
 
+  if (warn_stack_larger_than && frame_size > stack_larger_than_size)
+    warning (OPT_Wstack_larger_than_, "stack usage is %d bytes", frame_size);
+
   if (flag_stack_usage)
     current_function_static_stack_size = frame_size;
 
@@ -7864,6 +7877,8 @@ alpha_expand_prologue (void)
   if (flag_stack_check)
     probed_size += STACK_CHECK_PROTECT;
 
+if (flag_stack_check || STACK_CHECK_BUILTIN)
+  {
   if (probed_size <= 32768)
     {
       if (probed_size > 4096)
@@ -7957,6 +7972,44 @@ alpha_expand_prologue (void)
 							? -frame_size + 64
 							: -frame_size))));
     }
+    }
+  else
+    {
+      if (frame_size <= 32768)
+	{
+	  if (frame_size != 0)
+	    FRP (emit_insn (gen_adddi3 (stack_pointer_rtx, stack_pointer_rtx,
+					GEN_INT (TARGET_ABI_UNICOSMK
+						 ? -frame_size + 64
+						 : -frame_size))));
+	}
+      else
+	{
+	  rtx count = gen_rtx_REG (DImode, 23);
+	  rtx seq;
+ 
+	  emit_move_insn (count, GEN_INT (TARGET_ABI_UNICOSMK
+					  ? -frame_size + 64
+					  : -frame_size));
+	  seq = emit_insn (gen_adddi3 (stack_pointer_rtx, stack_pointer_rtx,
+				       count));
+ 
+	  /* This alternative is special, because the DWARF code cannot
+	     possibly intuit through the loop above.  So we invent this
+	     note it looks at instead.  */
+	  RTX_FRAME_RELATED_P (seq) = 1;
+	  REG_NOTES (seq)
+	    = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
+				 gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+				   gen_rtx_PLUS (Pmode, stack_pointer_rtx,
+						 GEN_INT (TARGET_ABI_UNICOSMK
+							  ? -frame_size + 64
+							  : -frame_size))),
+				 REG_NOTES (seq));
+	}
+    }
+
+
 
   if (!TARGET_ABI_UNICOSMK)
     {
